Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    list: [{
      pagePath: "/pages/answer/answer",
      iconPath: "/images/FirstPage.png",
      selectedIconPath: "/images/FirstPage.png",
      text: "首页"
    },  
    {
      pagePath: "/pages/contacts/contacts",
      iconPath: "/images/icon-aftersale.png",
      selectedIconPath: "/images/icon-aftersale.png",
      text: "售后"
    },
    {
      pagePath: "/pages/answers/answers",
      iconPath: "/images/icon-order.png",
      selectedIconPath: "/images/icon-order.png",
      text: "订单"
    },
    {
      pagePath: "/pages/index/index",
      iconPath: "/images/icon_API_me.png",
      selectedIconPath: "/images/icon_API_me.png",
      text: "个人中心"
    }


  ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})